package ru.amse.baltijsky.javascheme.importer;

import ru.amse.baltijsky.javascheme.importer.test.SampleImporterTest1;
import ru.amse.baltijsky.javascheme.importer.test.SampleImporterTest2;
import ru.amse.baltijsky.javascheme.importer.test.SampleImporterTest3;
import ru.amse.baltijsky.javascheme.importer.test.TestImporter;

public class ImporterFactory implements IImporterFactory {
    public IImporter createImporter(String alias) throws IllegalArgumentException {
        if (alias.equalsIgnoreCase("Sample1")) {
            return new SampleImporterTest1();
        } else if (alias.equalsIgnoreCase("Sample2")) {
            return new SampleImporterTest2();
        } else if (alias.equalsIgnoreCase("Sample3")) {
            return new SampleImporterTest3();
        } else if (alias.equalsIgnoreCase("java")) {
            return new ru.amse.baltijsky.javascheme.importer.sablecc.java15.SableCCImporter();
        } else if (alias.equalsIgnoreCase("test")) {
            return new TestImporter();
        } else {
            throw new IllegalArgumentException("No importer found with name " + alias);
        }
    }
}
